import * as api from "../../api/mine";
import * as data from "../../api/data";

var dayjs = require('dayjs');

Page({
    data: {
        dataType:"DAY",
        brand:[],
        countDate:""
    },
    onLoad( options ){
        let countDate = decodeURIComponent(options.countDate)
        this.setData({
            dataType:options.dataType,
            countDate:countDate
        })
        this.get_data_list();
    },
    async get_data_list(){

        let brand = await data.getRankForBrand({
            dataType:this.data.dataType,
            countDate:this.data.countDate,
            limitNum:100000
        });
        this.setData({
            brand:brand
        })
    },
    change_header_data(e){
        this.setData({
            dataType:e.detail.dataType,
            countDate:e.detail.countDate
        })
        this.get_data_list();
    },
})


